import { createApp } from 'vue'
import App from './App.vue'
import router from './router' // 导入路由配置
import store from './store' // 导入 Vuex store
import $http from '@/utils/request'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import '@/style/common/index.less'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import * as $API from '@/utils/api'
import * as _ from 'lodash';
import * as $T from '@/utils/tools'
import $dayjs from 'dayjs'
import * as $CONST from '@/utils/constant'
import i18n from './locales/i18n'
import './style.css'

const app = createApp(App)

app.config.globalProperties.$_ = _
app.config.globalProperties.$http = $http
app.config.globalProperties.$T = $T
app.config.globalProperties.$dayjs = $dayjs
app.config.globalProperties.$CONST = $CONST
app.config.globalProperties.$API = $API

for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
}

app.use(ElementPlus)
app.use(i18n)
app.use(router)
app.use(store) // 使用 Vuex store
app.mount('#app')
